home *** CD-ROM | disk | FTP | other *** search
- Path: tko.dec.com!diamond
- From: diamond@tko.dec.com (Norman Diamond)
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: Integral conversion e.t.c.
- Followup-To: comp.std.c
- Date: 25 Jan 1996 05:54:52 GMT
- Organization: Digital Equipment Corporation Japan , Tokyo
- Message-ID: <4e75vc$o1i@usenet.pa.dec.com>
- References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <4e1nd8$hv0@solutions.solon.com> <3104bfc8.132251392@nntp.ix.netcom.com> <4e2ppd$lsu@solutions.solon.com> <DLnG5H.748@mv.mv.com> <DLoy4x.AFG@mv.mv.com>
- Reply-To: diamond@jrdv04.enet.dec-j.co.jp (Norman Diamond)
- NNTP-Posting-Host: jit533.tko.dec.com
-
- In article <DLoy4x.AFG@mv.mv.com>, ENGR@GSSI.MV.COM (Michael Furman) writes:
- > Could somebody please clarify is "C" standard so strict and does not let
- >use some constructions that "C++" draft stadard let? Namely:
- >1. Integer conversion when source value can not be represented in destination
- >type. In C++ it is defined. In case of both unsigned types it completely
- >defined in standard; othervise details of "how it will be converted" must
- >be defined by implementation.
-
- This is the same in C, except in some cases involving floating-point.
- If a floating-point number is demoted or converted to an integral type
- but the value doesn't fit in the new type then behavior is undefined.
-
- >2. Implementation extention: additional forms of function main, like:
- >int main(int argc, char * * argv, char * env);
- >In C++ draft standard said that any implementation must allow 2 kinds if
- >"main" definitions, but does not forbid extentions.
-
- The C standard is the same. Any program that obeys the standard will
- have one of the 2 prescribed kinds of "main" definitions, and every
- implementation must allow those 2 kinds. This is not in a Syntax or
- Constraints section, so violations do not require diagnostics.
- Implementations are free to offer extensions silently, offer extensions
- noisily, reject programs that depend on such extensions, erase your
- hard disk, or whatever they like.
-
- If you have some reason to write implementation-dependent code and
- depend on extensions promised by your vendor, the standard does not
- stop you. 50% of programs do this. (The other 50% depend on extensions
- that are not promised by their vendors :-)
- --
- << If this were the company's opinion, I would not be allowed to post it. >>
- "I paid money for this car, I pay taxes for vehicle registration and a driver's
- license, so I can drive in any lane I want, and no innocent victim gets to call
- the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
-